<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<script language="javascript" type="text/javascript" src="../../files/js/validacoes.js"></script>
    <p:resources/>  
</h:head>
<h:body>
		<h:form id="formCadastro">
		<p:panel header = "Buscar Vagas">
		
			<h:panelGrid columns="2">
			
			<h:outputText value="Especialidade: " />
				 <h:selectOneMenu value="#{consultaBean.tEspecialidade}" >  
		                <f:selectItem itemLabel="Selecione a Especialidade"  itemValue="Selecione" />
		                <f:selectItem itemLabel="Acupuntura" itemValue="Acupuntura"/>
		                <f:selectItem itemLabel="Cardiologista" itemValue="Cardiologista"/>
		                <f:selectItem itemLabel="Clinica Geral"  itemValue="Clinica Geral"/> 
		                <f:selectItem itemLabel="Cirurgiao" itemValue="Cirurgiao"/>
		                <f:selectItem itemLabel="Endocrinologista" itemValue="Endocrinologista"/>		                 		               
		                <f:selectItem itemLabel="Ortopedia" itemValue="Ortopedia"/>
		                <f:selectItem itemLabel="Quiropraxia" itemValue="Quiropraxia"/>
		                <f:selectItem itemLabel="Nutricional" itemValue="Nutricionista"/>
		                <f:selectItem itemLabel="Psicologia" itemValue="Psicologia"/>  
           		 </h:selectOneMenu> 
				
				<h:outputText value="Clinica: " />
							<h:selectOneMenu value="#{consultaBean.tNomeClin}" >  
				                <f:selectItem itemLabel="Campinas" itemValue="Campinas"/>
					            <f:selectItem itemLabel="Carapicuiba" itemValue="Carapicuiba"/>
				                <f:selectItem itemLabel="Guarulhos" itemValue="Guarulhos"/>  
				                <f:selectItem itemLabel="Lapa" itemValue="Lapa"/>
				                <f:selectItem itemLabel="Osasco" itemValue="Osasco"/>
				                <f:selectItem itemLabel="Sao Paulo" itemValue="Sao Paulo"/>
				                <f:selectItem itemLabel="Santos" itemValue="Santos"/>  
		           			</h:selectOneMenu> 
	        	

							
							
			   <h:outputText value="Dia: " />  
		       <p:selectManyCheckbox value="#{consultaBean.tDiasSemana}">  
		            <f:selectItem itemLabel="Segunda" itemValue="2"  />  
		            <f:selectItem itemLabel="Terca" itemValue="3" />  
		            <f:selectItem itemLabel="Quarta" itemValue="4" />
		            <f:selectItem itemLabel="Quinta" itemValue="5" />
		            <f:selectItem itemLabel="Sexta" itemValue="6" />
		            <f:selectItem itemLabel="Sabado" itemValue="7" />
		       </p:selectManyCheckbox> 
		        
		       <h:outputText value="Periodo: " />  
		       <p:selectManyCheckbox value="#{consultaBean.tPeriodo}" >  
		            <f:selectItem itemLabel="Manha (07:00 a 12:00)" itemValue="0" />  
		            <f:selectItem itemLabel="Tarde (12:01 a 18:00)" itemValue="1" />  
		            <f:selectItem itemLabel="Noite (18:01 a 20:00)" itemValue="2" />  
		        </p:selectManyCheckbox> 	
		        		
				
			</h:panelGrid>
			
			<h:panelGrid id="gridBotoes" columns="1">
	
				<p:commandButton id="btPesquisar" value="Pesquisar" action="#{consultaBean.pesquisar()}" update=":formCadastro:consultas, :formCadastro:growl"
				 onclick="tabelaAparece()" />
				
				
				<p:growl globalOnly="true" id="growl"  showDetail="true" sticky="true"></p:growl>
			</h:panelGrid>
			
  
		  <div id="tableConsulta" style="visibility: hidden;">
		    <p:dataTable id="consultas" var="consulta" value="#{consultaBean.listaUsuario}" rows="10" paginator="true">  
		  
		  
		  		<p:column headerText="Medico" style="width:24%">  
		            <h:outputText value="#{consulta.medico}" />  
		        </p:column>
		        
		  		<p:column headerText="Dia" style="width:24%">  
		            <h:outputText value="#{consulta.diaSemana}" />  
		        </p:column>
		  		
		        <p:column headerText="Data da Consulta" style="width:24%">  
		            <h:outputText value="#{consulta.data}" />  
		        </p:column>
		        
		        <p:column headerText="Hora da Consulta" style="width:24%">  
		            <h:outputText value="#{consulta.hora}"/>  
		        </p:column>
		         
		  
		  
		        <p:column style="width:4%">  
		                <p:commandButton id="selectButton" icon="ui-icon-search"  action="#{consultaBean.marcarConsulta()}">
		                <f:setPropertyActionListener value="#{consulta}" target="#{consultaBean.selectedCons}" />  
		            </p:commandButton>  
		        </p:column>  
		  
		    </p:dataTable>
		    
		    </div>
		    
		    <!--<p:dialog header="Marcar da Consulta" widgetVar="carDialog" resizable="false" id="carDlg"  
		                showEffect="fade" hideEffect="explode" modal="true">  
		  
		        <h:panelGrid id="display" columns="2" cellpadding="4" style="margin:0 auto;">  
		  
		  
		  			<h:outputText value="Dia" />  
		            <h:outputText value="#{consultaBean.selectedCons.diaSemana}" style="font-weight:bold"/> 
		  
		            <h:outputText value="Data da Consulta" />  
		            <h:outputText value="#{consultaBean.selectedCons.data}" style="font-weight:bold"/>  
		  
		            <h:outputText value="Email" />  
		            <h:outputText value="#{consultaBean.selectedCons.hora}" style="font-weight:bold"/>  
		  		
		  			
			       <p:commandButton  id="btInseCons" value="Confirmao5" />
		  
		        </h:panelGrid>  
		  
		    </p:dialog>  
			
		--></p:panel>
		</h:form>
</h:body>
</html>